<?php
// $Id$

include_once('BaseModel.class.php');

class DTRSendConfigModel extends BaseModel
{
    function collect()
	{
        $query = "SELECT * FROM dtr_sending_config";
		return $this->select_all($query);
    }

    function detail ($id)
    {
        $query = "SELECT * FROM dtr_sending_config WHERE id='$id'";
        return $this->select_one($query);
    }

    /*
     * Add members and return the new member_id
     *
     */
    function ins($detail)
    {
        return $this->insert('dtr_sending_config', $detail);
        return $this->last_insert_id('dtr_sending_config');
    }

    /*
     * Update categories for a particular categories_id
     *
     */
    function edit ($id, $detail)
    {
        return $this->update('dtr_sending_config', $detail, "id = '$id'");
    }

    function disable_all()
    {
        $query = "UPDATE dtr_sending_config SET enabled = '0'";
        return $this->query($query, false);
    }
    function activate ($id)
    {
        $query = "UPDATE dtr_sending_config SET enabled = '1' WHERE id='$id'";
        return $this->query($query, false);
    }
}

?>
